package com.nms.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.nms.dao.TakeDao;
import com.nms.model.Email;
import com.nms.model.TakeUser;
import com.nms.model.Type;
import com.nms.service.TakeService;

@Component("takeService")
public class TakeServiceImpl implements TakeService {
	private TakeDao takeDao;

	@Override
	public List<Type> findAllGroup() {
		return takeDao.findAllGroup();
	}

	@Override
	public List<TakeUser> getUserByType(String typename) {
		return takeDao.getUserByType(typename);
	}

	@Override
	public boolean cancel(int type, String username) {
		return takeDao.cancel(type, username);
	}

	@Override
	public boolean take(Type type, String username) {
		return takeDao.take(type, username);
	}

	@Override
	public List<Email> findUTake(String username) {
		return takeDao.findUTake(username);
	}

	@Override
	public List<Type> getUNotTakeList(String username) {
		return takeDao.getUNotTakeList(username);
	}

	@Override
	public List<TakeUser> getUTakeList(String username) {
		return takeDao.getUTakeList(username);
	}

	public TakeDao getTakeDao() {
		return takeDao;
	}

	@Resource(name = "takeDao")
	public void setTakeDao(TakeDao takeDao) {
		this.takeDao = takeDao;
	}

}
